<?php if(isset($_SESSION['user']['user_id']) && $_SESSION['user']['user_id']!=""){?>
<div class="col-md-12">
<div class="main-content" id="main-content">
		<div class="sub-content">
			<div class="top-header page-header clearfix">
				<h1>Switch to Admin or Superadmin</h1>
			</div><br/>
		<div class="user-profile1" style="margin:0 auto;width:50%;">
			<div class="sub-forms" >			
				<div class="row">
					<label class="col-sm-3">Admins</label>
					<div>							
						<select id="admin" name="admin" onchange="adminList();"> 
							<option value="0">Select</option>
								<? if(isset($this->getalladmins) && count($this->getalladmins)!=0){
								foreach($this->getalladmins as $admins){?>
									<option value="<? echo $admins->user_id;?>" ><? echo $admins->company_name;?></option>
								<?}}?>
						</select>					
					</div>
				</div>
				<div class="row spacer20">
						<label class=" col-sm-3">&nbsp;</label>
										
						<a href="<? echo $this->Url('users');?>/superadmin-first?user_id=<? echo $this->getdetails_superadmin->user_id;?>" class="btn btn-danger">Superadmin</a>
					
				</div>
			</div>	
		</div>
	</div>
</div></div>
</html>
<script>
	function adminList(){
		var user_id=$("#admin").val();
		if(user_id!='0'){
			window.location=BASE_URL+'/users/superadmin-first?user_id='+user_id;
		}else{
			alert('Please select a admin');return false;
		}
	}
</script>
<?php }else{?>
<script>
	window.location='<? echo $this->Url('home')?>';
</script>
<?php }?>

        